package com.fesine.ch01.lesson08.suspendResumeTest;

/**
 * @Author: Fesine
 * @CreateDate:2016/6/27
 * @UpdateUser:修改人名称
 * @UpdateDate:2016/6/27
 * @UpdateRemark:修改具体的内容
 */
public class Run {
    public static void main(String[] args) {
        try {
            MyThread myThread = new MyThread();
            myThread.start();
            Thread.sleep(5000);
            //A段
            myThread.suspend();
            System.out.println("A= " + System.currentTimeMillis() + " i=" + myThread.getI());
            Thread.sleep(5000);
            System.out.println("A= " + System.currentTimeMillis() + " i=" + myThread.getI());
            //B段
            myThread.resume();
            Thread.sleep(5000);
            //C段
            myThread.suspend();
            System.out.println("B= " + System.currentTimeMillis() + " i=" + myThread.getI());
            Thread.sleep(5000);
            System.out.println("B= " + System.currentTimeMillis() + " i=" + myThread.getI());
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
